import 'package:flutter/material.dart';
import 'package:flutter_app/ui/apply/ApplyListModel.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';

import '../ApplyListPage.dart';
import 'apply_state.dart';

class ApplyLogic extends GetxController with GetSingleTickerProviderStateMixin {
  final ApplyState state = ApplyState();

  late TabController controller;

  late List<Widget> widgets = [];

  @override
  void onInit() {
    super.onInit();
    controller = new TabController(length: state.tabs.length, vsync: this);
    for (int i = 0; i < state.tabs.length; i++) {
      widgets.add(MultiProvider(
          providers: [ChangeNotifierProvider(create: (_) => ApplyListModel())],
          child: ApplyListPage(page: i.toString())));
    }
  }

  @override
  void onReady() {
    super.onReady();
  }

  @override
  void onClose() {
    super.onClose();
    controller.dispose();
  }
}
